package tutorprojectgroup6.tutorapp.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import tutorprojectgroup6.tutorapp.entity.User;
import tutorprojectgroup6.tutorapp.service.UserService;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author charles
 * @since 2024-12-18
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/getUserList")
    public List<User> getUserList() {
        List<User> userList = new ArrayList<>();
        userList = userService.list();
        return userList;
    }
}

